import request from '@/utils/request.js'

// 根据一级分类的id获取详细信息
export const findTopCategory = (id) => {
  return request({
    method: 'get',
    url: '/category',
    data: { id }
  })
}

// 获取二级分类的筛选条件数据
export const findSubCategoryFilter = (id) => {
  return request({
    method: 'get',
    url: '/category/sub/filter',
    data: { id }
  })
}

// 获取分类相关的商品数据
// page表示当前页码；pageSize表示每页的条数
// data = { page: 1, pageSize: 10 }
export const findSubCategoryGoods = (data) => {
  return request({
    method: 'post',
    url: '/category/goods/temporary',
    data
  })
}
